
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>3-6 python3小白课：字典的常用方法 · python3小白课笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="雪山凌狐">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-material-light.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-auto-scroll-table/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-lightbox/css/lightbox.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-ad/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-image-captions/image-captions.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-advanced-emoji/emoji-website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-flexible-alerts/style.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../css/website.css">
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../chapter4/" />
    
    
    <link rel="prev" href="3-5 python3小白课：字典操作基础.html" />
    

    
        <link rel="shortcut icon" href='../assets/favicon.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../assets/favicon.ico' type="image/x-icon">
    
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://fox-9.com" target="_blank" class="custom-link">雪山凌狐教程</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Python3小白课 介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Catalog.html">
            
                <a href="../Catalog.html">
            
                    
                    课程目录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../chapter1/">
            
                <a href="../chapter1/">
            
                    
                    一、Python初识
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../chapter1/1-1 python3小白课：python语言简介.html">
            
                <a href="../chapter1/1-1 python3小白课：python语言简介.html">
            
                    
                    1-1 python3小白课：python语言简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../chapter1/1-2 python3小白课：python下载.html">
            
                <a href="../chapter1/1-2 python3小白课：python下载.html">
            
                    
                    1-2 python3小白课：python下载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../chapter1/1-3 python3小白课：python安装.html">
            
                <a href="../chapter1/1-3 python3小白课：python安装.html">
            
                    
                    1-3 python3小白课：python安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../chapter1/1-4 python3小白课：我的第一个python脚本.html">
            
                <a href="../chapter1/1-4 python3小白课：我的第一个python脚本.html">
            
                    
                    1-4 python3小白课：我的第一个python脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../chapter1/1-5 python3小白课：如何运行py文件.html">
            
                <a href="../chapter1/1-5 python3小白课：如何运行py文件.html">
            
                    
                    1-5 python3小白课：如何运行py文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../chapter1/1-6 python3小白课：使用python IDLE.html">
            
                <a href="../chapter1/1-6 python3小白课：使用python IDLE.html">
            
                    
                    1-6 python3小白课：使用python IDLE
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../chapter1/1-7 python3小白课：使用python shell.html">
            
                <a href="../chapter1/1-7 python3小白课：使用python shell.html">
            
                    
                    1-7 python3小白课：使用python shell
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../chapter2/">
            
                <a href="../chapter2/">
            
                    
                    二、变量、简单类型和运算符
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../chapter2/2-1 python3小白课：啥是变量.html">
            
                <a href="../chapter2/2-1 python3小白课：啥是变量.html">
            
                    
                    2-1 python3小白课：啥是变量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../chapter2/2-2 python3小白课：定义常量.html">
            
                <a href="../chapter2/2-2 python3小白课：定义常量.html">
            
                    
                    2-2 python3小白课：定义常量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../chapter2/2-3 python3小白课：注释让你事半功倍.html">
            
                <a href="../chapter2/2-3 python3小白课：注释让你事半功倍.html">
            
                    
                    2-3 python3小白课：注释让你事半功倍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../chapter2/2-4 python3小白课：数值类型之整型.html">
            
                <a href="../chapter2/2-4 python3小白课：数值类型之整型.html">
            
                    
                    2-4 python3小白课：数值类型之整型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../chapter2/2-5 python3小白课：数值类型之浮点型.html">
            
                <a href="../chapter2/2-5 python3小白课：数值类型之浮点型.html">
            
                    
                    2-5 python3小白课：数值类型之浮点型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../chapter2/2-6 python3小白课：数值类型之复数.html">
            
                <a href="../chapter2/2-6 python3小白课：数值类型之复数.html">
            
                    
                    2-6 python3小白课：数值类型之复数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="../chapter2/2-7 python3小白课：字符串入门.html">
            
                <a href="../chapter2/2-7 python3小白课：字符串入门.html">
            
                    
                    2-7 python3小白课：字符串入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="../chapter2/2-8 python3小白课：字节串.html">
            
                <a href="../chapter2/2-8 python3小白课：字节串.html">
            
                    
                    2-8 python3小白课：字节串
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.9" data-path="../chapter2/2-9 python3小白课：字符串进阶.html">
            
                <a href="../chapter2/2-9 python3小白课：字符串进阶.html">
            
                    
                    2-9 python3小白课：字符串进阶
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.10" data-path="../chapter2/2-10 python3小白课：赋值运算符.html">
            
                <a href="../chapter2/2-10 python3小白课：赋值运算符.html">
            
                    
                    2-10 python3小白课：赋值运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.11" data-path="../chapter2/2-11 python3小白课：算术运算符.html">
            
                <a href="../chapter2/2-11 python3小白课：算术运算符.html">
            
                    
                    2-11 python3小白课：算术运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.12" data-path="../chapter2/2-12 python3小白课：索引运算符.html">
            
                <a href="../chapter2/2-12 python3小白课：索引运算符.html">
            
                    
                    2-12 python3小白课：索引运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.13" data-path="../chapter2/2-13 python3小白课：比较运算符.html">
            
                <a href="../chapter2/2-13 python3小白课：比较运算符.html">
            
                    
                    2-13 python3小白课：比较运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.14" data-path="../chapter2/2-14 python3小白课：身份运算符.html">
            
                <a href="../chapter2/2-14 python3小白课：身份运算符.html">
            
                    
                    2-14 python3小白课：身份运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.15" data-path="../chapter2/2-15 python3小白课：逻辑运算符.html">
            
                <a href="../chapter2/2-15 python3小白课：逻辑运算符.html">
            
                    
                    2-15 python3小白课：逻辑运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.16" data-path="../chapter2/2-16 python3小白课：位运算符.html">
            
                <a href="../chapter2/2-16 python3小白课：位运算符.html">
            
                    
                    2-16 python3小白课：位运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.17" data-path="../chapter2/2-17 python3小白课：赋值运算符扩展.html">
            
                <a href="../chapter2/2-17 python3小白课：赋值运算符扩展.html">
            
                    
                    2-17 python3小白课：赋值运算符扩展
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.18" data-path="../chapter2/2-18 python3小白课：三目运算符.html">
            
                <a href="../chapter2/2-18 python3小白课：三目运算符.html">
            
                    
                    2-18 python3小白课：三目运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.19" data-path="../chapter2/2-19 python3小白课：成员运算符.html">
            
                <a href="../chapter2/2-19 python3小白课：成员运算符.html">
            
                    
                    2-19 python3小白课：成员运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.20" data-path="../chapter2/2-20 python3小白课：运算符优先级.html">
            
                <a href="../chapter2/2-20 python3小白课：运算符优先级.html">
            
                    
                    2-20 python3小白课：运算符优先级
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="./">
            
                <a href="./">
            
                    
                    三、列表、元组和字典
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="3-1 python3小白课：列表和元组的区别.html">
            
                <a href="3-1 python3小白课：列表和元组的区别.html">
            
                    
                    3-1 python3小白课：列表和元组的区别
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="3-2 python3小白课：列表元组入门.html">
            
                <a href="3-2 python3小白课：列表元组入门.html">
            
                    
                    3-2 python3小白课：列表元组入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="3-3 python3小白课：深入列表.html">
            
                <a href="3-3 python3小白课：深入列表.html">
            
                    
                    3-3 python3小白课：深入列表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="3-4 python3小白课：字典初识.html">
            
                <a href="3-4 python3小白课：字典初识.html">
            
                    
                    3-4 python3小白课：字典初识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="3-5 python3小白课：字典操作基础.html">
            
                <a href="3-5 python3小白课：字典操作基础.html">
            
                    
                    3-5 python3小白课：字典操作基础
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.5.6" data-path="3-6 python3小白课：字典的常用方法.html">
            
                <a href="3-6 python3小白课：字典的常用方法.html">
            
                    
                    3-6 python3小白课：字典的常用方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../chapter4/">
            
                <a href="../chapter4/">
            
                    
                    四、流程控制
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../chapter4/4-1 python3小白课：if分支结构.html">
            
                <a href="../chapter4/4-1 python3小白课：if分支结构.html">
            
                    
                    4-1 python3小白课：if分支结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../chapter4/4-2 python3小白课：while循环结构.html">
            
                <a href="../chapter4/4-2 python3小白课：while循环结构.html">
            
                    
                    4-2 python3小白课：while循环结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../chapter4/4-3 python3小白课：for-in循环结构.html">
            
                <a href="../chapter4/4-3 python3小白课：for-in循环结构.html">
            
                    
                    4-3 python3小白课：for-in循环结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../chapter4/4-4 python3小白课：for表达式.html">
            
                <a href="../chapter4/4-4 python3小白课：for表达式.html">
            
                    
                    4-4 python3小白课：for表达式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../chapter5/">
            
                <a href="../chapter5/">
            
                    
                    五、自定义函数
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../chapter5/5-1 python3小白课：函数是什么.html">
            
                <a href="../chapter5/5-1 python3小白课：函数是什么.html">
            
                    
                    5-1 python3小白课：函数是什么
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../chapter5/5-2 python3小白课：函数入门.html">
            
                <a href="../chapter5/5-2 python3小白课：函数入门.html">
            
                    
                    5-2 python3小白课：函数入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../chapter5/5-3 python3小白课：递归函数.html">
            
                <a href="../chapter5/5-3 python3小白课：递归函数.html">
            
                    
                    5-3 python3小白课：递归函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../chapter5/5-4 python3小白课：关键字参数.html">
            
                <a href="../chapter5/5-4 python3小白课：关键字参数.html">
            
                    
                    5-4 python3小白课：关键字参数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../chapter5/5-5 python3小白课：参数默认值.html">
            
                <a href="../chapter5/5-5 python3小白课：参数默认值.html">
            
                    
                    5-5 python3小白课：参数默认值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="../chapter5/5-6 python3小白课：参数收集.html">
            
                <a href="../chapter5/5-6 python3小白课：参数收集.html">
            
                    
                    5-6 python3小白课：参数收集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="../chapter5/5-7 python3小白课：变量作用域.html">
            
                <a href="../chapter5/5-7 python3小白课：变量作用域.html">
            
                    
                    5-7 python3小白课：变量作用域
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.8" data-path="../chapter5/5-8 python3小白课：局部函数.html">
            
                <a href="../chapter5/5-8 python3小白课：局部函数.html">
            
                    
                    5-8 python3小白课：局部函数
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../chapter6/">
            
                <a href="../chapter6/">
            
                    
                    六、模块和包
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../chapter6/6-1 python3小白课：模块的导入.html">
            
                <a href="../chapter6/6-1 python3小白课：模块的导入.html">
            
                    
                    6-1 python3小白课：模块的导入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../chapter6/6-2 python3小白课：自己写模块.html">
            
                <a href="../chapter6/6-2 python3小白课：自己写模块.html">
            
                    
                    6-2 python3小白课：自己写模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../chapter6/6-3 python3小白课：导入模块详解.html">
            
                <a href="../chapter6/6-3 python3小白课：导入模块详解.html">
            
                    
                    6-3 python3小白课：导入模块详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../chapter6/6-4 python3小白课：包是什么.html">
            
                <a href="../chapter6/6-4 python3小白课：包是什么.html">
            
                    
                    6-4 python3小白课：包是什么
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../chapter6/6-5 python3小白课：定义包.html">
            
                <a href="../chapter6/6-5 python3小白课：定义包.html">
            
                    
                    6-5 python3小白课：定义包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="../chapter6/6-6 python3小白课：包成员导入.html">
            
                <a href="../chapter6/6-6 python3小白课：包成员导入.html">
            
                    
                    6-6 python3小白课：包成员导入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="../chapter6/6-7 python3小白课：模块内容查看.html">
            
                <a href="../chapter6/6-7 python3小白课：模块内容查看.html">
            
                    
                    6-7 python3小白课：模块内容查看
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="../chapter6/6-8 python3小白课：解锁你心仪的三方包.html">
            
                <a href="../chapter6/6-8 python3小白课：解锁你心仪的三方包.html">
            
                    
                    6-8 python3小白课：解锁你心仪的三方包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.9" data-path="../chapter6/6-9 python3小白课：虚拟环境介绍和安装.html">
            
                <a href="../chapter6/6-9 python3小白课：虚拟环境介绍和安装.html">
            
                    
                    6-9 python3小白课：虚拟环境介绍和安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.10" data-path="../chapter6/6-10 python3小白课：虚拟环境使用.html">
            
                <a href="../chapter6/6-10 python3小白课：虚拟环境使用.html">
            
                    
                    6-10 python3小白课：虚拟环境使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../chapter7/">
            
                <a href="../chapter7/">
            
                    
                    七、类和对象
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../chapter7/7-1 python3小白课：一节课搞懂面向对象.html">
            
                <a href="../chapter7/7-1 python3小白课：一节课搞懂面向对象.html">
            
                    
                    7-1 python3小白课：一节课搞懂面向对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../chapter7/7-2 python3小白课：定义类和实例化对象.html">
            
                <a href="../chapter7/7-2 python3小白课：定义类和实例化对象.html">
            
                    
                    7-2 python3小白课：定义类和实例化对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../chapter7/7-3 python3小白课：了解实例方法.html">
            
                <a href="../chapter7/7-3 python3小白课：了解实例方法.html">
            
                    
                    7-3 python3小白课：了解实例方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../chapter7/7-4 python3小白课：用property函数定义属性.html">
            
                <a href="../chapter7/7-4 python3小白课：用property函数定义属性.html">
            
                    
                    7-4 python3小白课：用property函数定义属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../chapter7/7-5 python3小白课：封装和隐藏.html">
            
                <a href="../chapter7/7-5 python3小白课：封装和隐藏.html">
            
                    
                    7-5 python3小白课：封装和隐藏
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.6" data-path="../chapter7/7-6 python3小白课：类的继承和多继承.html">
            
                <a href="../chapter7/7-6 python3小白课：类的继承和多继承.html">
            
                    
                    7-6 python3小白课：类的继承和多继承
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.7" data-path="../chapter7/7-7 python3小白课：重写父类方法和使用super函数.html">
            
                <a href="../chapter7/7-7 python3小白课：重写父类方法和使用super函数.html">
            
                    
                    7-7 python3小白课：重写父类方法和使用super函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.8" data-path="../chapter7/7-8 python3小白课：类的多态性.html">
            
                <a href="../chapter7/7-8 python3小白课：类的多态性.html">
            
                    
                    7-8 python3小白课：类的多态性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.9" data-path="../chapter7/7-9 python3小白课：可以被枚举的类.html">
            
                <a href="../chapter7/7-9 python3小白课：可以被枚举的类.html">
            
                    
                    7-9 python3小白课：可以被枚举的类
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../chapter8/">
            
                <a href="../chapter8/">
            
                    
                    八、异常处理机制
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../chapter8/8-1 python3小白课：最基本的异常处理.html">
            
                <a href="../chapter8/8-1 python3小白课：最基本的异常处理.html">
            
                    
                    8-1 python3小白课：最基本的异常处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../chapter8/8-2 python3小白课：多异常捕获.html">
            
                <a href="../chapter8/8-2 python3小白课：多异常捕获.html">
            
                    
                    8-2 python3小白课：多异常捕获
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../chapter8/8-3 python3小白课：查看详细异常信息.html">
            
                <a href="../chapter8/8-3 python3小白课：查看详细异常信息.html">
            
                    
                    8-3 python3小白课：查看详细异常信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../chapter8/8-4 python3小白课：异常机制中的else块.html">
            
                <a href="../chapter8/8-4 python3小白课：异常机制中的else块.html">
            
                    
                    8-4 python3小白课：异常机制中的else块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../chapter8/8-5 python3小白课：finally块回收资源.html">
            
                <a href="../chapter8/8-5 python3小白课：finally块回收资源.html">
            
                    
                    8-5 python3小白课：finally块回收资源
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.6" data-path="../chapter8/8-6 python3小白课：自己引发异常.html">
            
                <a href="../chapter8/8-6 python3小白课：自己引发异常.html">
            
                    
                    8-6 python3小白课：自己引发异常
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../Summary.html">
            
                <a href="../Summary.html">
            
                    
                    课程总结
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >3-6 python3小白课：字典的常用方法</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <html><head></head><body><div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon fa fa-hand-o-right"></span><a href="#python3&#x5C0F;&#x767D;&#x8BFE;&#xFF1A;&#x5B57;&#x5178;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;"><b></b>python3&#x5C0F;&#x767D;&#x8BFE;&#xFF1A;&#x5B57;&#x5178;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;</a></li><ul><ul><li><span class="title-icon fa fa-hand-o-right"></span><a href="#&#x5355;&#x8BCD;&#x91CA;&#x4E49;"><b></b>&#x5355;&#x8BCD;&#x91CA;&#x4E49;</a></li></ul></ul></ul></div><h1 id="python3&#x5C0F;&#x767D;&#x8BFE;&#xFF1A;&#x5B57;&#x5178;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;"><a name="python3&#x5C0F;&#x767D;&#x8BFE;&#xFF1A;&#x5B57;&#x5178;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;" class="anchor-navigation-ex-anchor" href="#python3&#x5C0F;&#x767D;&#x8BFE;&#xFF1A;&#x5B57;&#x5178;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;"><i class="fa fa-link" aria-hidden="true"></i></a>python3&#x5C0F;&#x767D;&#x8BFE;&#xFF1A;&#x5B57;&#x5178;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;</h1>
<p>&#x672C;&#x8282;&#x8BFE;&#x6211;&#x4EEC;&#x6765;&#x5927;&#x6982;&#x5C06;&#x4E00;&#x4E9B;&#x5B57;&#x5178;&#x81EA;&#x5E26;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;&#x3002;</p>
<p>&#x770B;&#x4F8B;&#x5B50;&#xFF1A;</p>
<pre class="language-"><code class="lang-python"><span class="token comment"># coding:utf-8</span>
<span class="token comment"># &#x67E5;&#x770B;&#x6709;&#x54EA;&#x4E9B;&#x5185;&#x7F6E;&#x65B9;&#x6CD5;&#xFF1F;&#xFF08;&#x6CE8;&#x610F;&#x5FFD;&#x7565;&#x79C1;&#x6709;&#x65B9;&#x6CD5;&#x548C;&#x7279;&#x6B8A;&#x65B9;&#x6CD5;&#xFF09;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">dir</span><span class="token punctuation">(</span><span class="token builtin">dict</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
a <span class="token operator">=</span> <span class="token punctuation">{</span>
    <span class="token number">1</span><span class="token punctuation">:</span> <span class="token number">90</span><span class="token punctuation">,</span>
    <span class="token string">&quot;1&quot;</span><span class="token punctuation">:</span> <span class="token number">89</span><span class="token punctuation">,</span>
    <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token number">100</span><span class="token punctuation">,</span>
    <span class="token string">&quot;&#x8BED;&#x6587;&quot;</span><span class="token punctuation">:</span> <span class="token number">90</span><span class="token punctuation">,</span>
    <span class="token string">&quot;&#x6570;&#x5B66;&quot;</span><span class="token punctuation">:</span> <span class="token number">89</span><span class="token punctuation">,</span>
    <span class="token string">&quot;&#x8BA1;&#x7B97;&#x673A;&quot;</span><span class="token punctuation">:</span> <span class="token number">100</span><span class="token punctuation">,</span>
    <span class="token string">&quot;&#x82F1;&#x8BED;&quot;</span><span class="token punctuation">:</span> <span class="token number">89.57</span>
<span class="token punctuation">}</span>
<span class="token comment"># clear&#xFF0C;&#x8DDF;&#x5217;&#x8868;&#x5143;&#x7EC4;&#x4E00;&#x6837;&#xFF0C;&#x4F1A;&#x5C06;&#x5B57;&#x5178;&#x53D8;&#x4E3A;&#x7A7A;&#x5B57;&#x5178;&#xFF0C;copy&#x65B9;&#x6CD5;&#x53EF;&#x4EE5;&#x590D;&#x5236;&#x4E00;&#x4E2A;&#x5B57;&#x5178;&#x526F;&#x672C;</span>
<span class="token comment"># &#x6CE8;&#x610F;&#x4E0D;&#x8981;&#x7528;b = a&#x8FD9;&#x6837;&#x7684;&#x5199;&#x6CD5;&#xFF0C;&#x8FD9;&#x6837;&#x5199;clear b&#x65F6;&#xFF0C;a&#x4E5F;&#x4F1A;&#x53D8;&#x7A7A;&#x5B57;&#x5178;</span>
b <span class="token operator">=</span> a<span class="token punctuation">.</span>copy<span class="token punctuation">(</span><span class="token punctuation">)</span>
b<span class="token punctuation">.</span>clear<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span>
<span class="token comment"># get&#x65B9;&#x6CD5;&#x975E;&#x5E38;&#x975E;&#x5E38;&#x5E38;&#x7528;&#xFF0C;&#x7528;&#x6765;&#x53D6;&#x5B57;&#x5178;&#x4E2D;&#x67D0;&#x4E2A;&#x952E;&#x7684;&#x503C;&#xFF0C;&#x4F7F;&#x7528;[]&#x53D6;&#x503C;&#x5982;&#x679C;&#x952E;&#x4E0D;&#x5B58;&#x5728;&#x4F1A;&#x62A5;&#x9519;&#xFF0C;&#x4F46;get&#x65B9;&#x6CD5;&#x53D6;&#x503C;&#x4E0D;&#x5B58;&#x5728;&#x65F6;&#xFF0C;</span>
<span class="token comment"># &#x4F1A;&#x8FD4;&#x56DE;None&#xFF0C;&#x6216;&#x8005;&#x53EF;&#x4EE5;&#x6307;&#x5B9A;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x4F5C;&#x4E3A;&#x8FD4;&#x56DE;&#x503C;&#x3002;&#x56E0;&#x6B64;&#xFF0C;&#x5B9E;&#x9645;&#x7F16;&#x5199;&#x4E2D;&#x66F4;&#x63A8;&#x8350;&#x7528;get&#x800C;&#x5F03;&#x7528;[]&#xFF0C;&#x9664;&#x975E;&#x4F60;&#x767E;&#x5206;&#x767E;&#x4FDD;&#x8BC1;&#x5B58;&#x5728;&#x8BE5;&#x952E;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">&quot;&#x8BED;&#x6587;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">&quot;&#x7F8E;&#x672F;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># &#x4F60;&#x4E5F;&#x53EF;&#x4EE5;&#x6307;&#x5B9A;&#x8FD4;&#x56DE;&#x503C;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>get<span class="token punctuation">(</span><span class="token string">&quot;&#x7F8E;&#x672F;&quot;</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token comment"># &#x6211;&#x4EEC;&#x9700;&#x8981;&#x533A;&#x522B;&#x4E8E;setdefault&#x65B9;&#x6CD5;&#xFF0C;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x4E00;&#x4E2A;&#x952E;&#x7684;&#x9ED8;&#x8BA4;&#x503C;&#xFF0C;&#x5F53;&#x8FD9;&#x4E2A;&#x952E;&#x627E;&#x5F97;&#x5230;&#x65F6;&#xFF0C;&#x4E0E;get&#x7B49;&#x6548;&#xFF0C;&#x8FD4;&#x56DE;&#x503C;</span>
<span class="token comment"># &#x4F46;&#x5F53;&#x8FD9;&#x4E2A;&#x952E;&#x4E0D;&#x5B58;&#x5728;&#x65F6;&#xFF0C;setdefault&#x4F1A;&#x7ED9;&#x5B57;&#x5178;&#x65B0;&#x589E;&#x8FD9;&#x4E2A;&#x952E;&#x5E76;&#x8D4B;&#x503C;&#x7ED9;&#x7684;&#x9ED8;&#x8BA4;&#x503C;&#xFF0C;&#x800C;get&#x4E0D;&#x4F1A;&#x65B0;&#x589E;&#x952E;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>setdefault<span class="token punctuation">(</span><span class="token string">&quot;&#x7F8E;&#x672F;&quot;</span><span class="token punctuation">,</span> <span class="token number">99</span><span class="token punctuation">)</span><span class="token punctuation">)</span>   <span class="token comment"># &#x952E;&#x4E0D;&#x5B58;&#x5728;&#xFF0C;&#x8FD4;&#x56DE;&#x8BBE;&#x5B9A;&#x7684;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x5E76;&#x6DFB;&#x52A0;&#x952E;&#x5230;&#x5B57;&#x5178;&#x4E2D;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>setdefault<span class="token punctuation">(</span><span class="token string">&quot;&#x7F8E;&#x672F;&quot;</span><span class="token punctuation">,</span> <span class="token number">98</span><span class="token punctuation">)</span><span class="token punctuation">)</span>   <span class="token comment"># &#x8FD9;&#x6B21;&#x952E;&#x5B58;&#x5728;&#xFF0C;&#x56E0;&#x6B64;&#x4E0D;&#x4F1A;&#x4FEE;&#x6539;&#x5B83;&#x7684;&#x503C;&#xFF0C;&#x53EF;&#x4EE5;&#x8FD4;&#x56DE;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
<span class="token comment"># update&#x65B9;&#x6CD5;&#x53EF;&#x4EE5;&#x7528;&#x65B0;&#x5B57;&#x5178;&#x5305;&#x542B;&#x7684;&#x952E;&#x503C;&#x5BF9;&#x6765;&#x66F4;&#x65B0;&#x539F;&#x6709;&#x5B57;&#x5178;&#xFF0C;&#x5F53;&#x539F;&#x6709;&#x5B57;&#x5178;&#x5B58;&#x5728;&#x8BE5;&#x952E;&#x65F6;&#xFF0C;&#x5219;&#x66F4;&#x65B0;</span>
<span class="token comment"># &#x5F53;&#x539F;&#x6709;&#x5B57;&#x5178;&#x4E0D;&#x5B58;&#x5728;&#x5BF9;&#x5E94;&#x952E;&#x65F6;&#xFF0C;&#x5219;&#x6DFB;&#x52A0;&#x8BE5;&#x952E;&#x503C;&#x5BF9;&#x8FDB;&#x53BB;</span>
a<span class="token punctuation">.</span>update<span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token string">&quot;&#x8BED;&#x6587;&quot;</span><span class="token punctuation">:</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token string">&quot;&#x4F53;&#x80B2;&quot;</span><span class="token punctuation">:</span> <span class="token number">92</span><span class="token punctuation">}</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>

<span class="token triple-quoted-string string">&quot;&quot;&quot;
&#x4E0A;&#x8FF0;&#x7684;&#x4E00;&#x4E9B;&#x547D;&#x4EE4;&#x662F;&#x5728;&#x6211;&#x4EEC;&#x77E5;&#x9053;&#x8FD9;&#x4E2A;&#x5B57;&#x5178;&#x6709;&#x4EC0;&#x4E48;key&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x6709;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x6211;&#x4EEC;&#x4E0D;&#x77E5;&#x9053;&#x8FD9;&#x4E2A;&#x5B57;&#x5178;&#x6709;&#x4EC0;&#x4E48;&#x952E;&#x3002;
&#x6709;&#x4EC0;&#x4E48;&#x529E;&#x6CD5;&#x80FD;&#x591F;&#x83B7;&#x53D6;&#x952E;&#x7684;&#x5217;&#x8868;&#x4EE5;&#x53CA;&#x503C;&#x7684;&#x5217;&#x8868;&#x5462;&#xFF1F;
&#x4F7F;&#x7528;items()&#x65B9;&#x6CD5;&#x53EF;&#x4EE5;&#x83B7;&#x53D6;&#x5B57;&#x5178;&#x7684;&#x6BCF;&#x4E2A;&#x952E;&#x503C;&#x5BF9;&#xFF0C;&#x901A;&#x8FC7;list&#x547D;&#x4EE4;&#x8F6C;&#x5316;&#x6210;&#x5217;&#x8868;&#xFF0C;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;&#x662F;&#x4E00;&#x4E2A;&#x952E;&#x503C;&#x5BF9;&#x5143;&#x7EC4;&#x3002;
&#x4F7F;&#x7528;keys()&#x65B9;&#x6CD5;&#x53EF;&#x4EE5;&#x83B7;&#x53D6;&#x5B57;&#x5178;&#x7684;&#x6BCF;&#x4E2A;&#x952E;&#xFF0C;&#x901A;&#x8FC7;list&#x547D;&#x4EE4;&#x8F6C;&#x5316;&#x6210;&#x5217;&#x8868;&#xFF0C;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;&#x662F;&#x4E00;&#x4E2A;&#x952E;&#x540D;&#x3002;
&#x4F7F;&#x7528;values()&#x65B9;&#x6CD5;&#x53EF;&#x4EE5;&#x83B7;&#x53D6;&#x5B57;&#x5178;&#x7684;&#x6BCF;&#x4E2A;&#x503C;&#xFF0C;&#x901A;&#x8FC7;list&#x547D;&#x4EE4;&#x8F6C;&#x5316;&#x6210;&#x5217;&#x8868;&#xFF0C;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;&#x662F;&#x4E00;&#x4E2A;&#x503C;&#x3002;
***&#x8FD9;&#x51E0;&#x4E2A;&#x65B9;&#x6CD5;&#x5728;&#x505A;&#x5B57;&#x5178;&#x679A;&#x4E3E;&#x65F6;&#x975E;&#x5E38;&#x6709;&#x7528;&#xFF0C;&#x8BF7;&#x52A1;&#x5FC5;&#x638C;&#x63E1;&#x3002;***
&quot;&quot;&quot;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">list</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>items<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">list</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>keys<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token builtin">list</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>values<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

<span class="token comment"># pop&#x65B9;&#x6CD5;&#x7528;&#x4E8E;&#x5F39;&#x51FA;&#x67D0;&#x4E2A;&#x952E;&#x503C;&#x5BF9;&#xFF0C;&#x5E76;&#x5220;&#x9664;&#x5B83;&#xFF0C;&#x627E;&#x5F97;&#x5230;&#x4F1A;&#x8FD4;&#x56DE;&#x5BF9;&#x5E94;&#x7684;&#x503C;&#xFF0C;&#x627E;&#x4E0D;&#x5230;&#x4F1A;&#x62A5;&#x9519;&#xFF0C;&#x8DDF;&#x5217;&#x8868;&#x7C7B;&#x4F3C;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>pop<span class="token punctuation">(</span><span class="token string">&quot;&#x8BED;&#x6587;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
<span class="token comment"># popitem&#x65B9;&#x6CD5;&#x53EF;&#x4EE5;&#x5F39;&#x51FA;&#x67D0;&#x4E2A;&#x952E;&#x503C;&#x5BF9;&#xFF0C;&#x5B9E;&#x9645;&#x662F;&#x5F39;&#x51FA;&#x5E95;&#x5C42;&#x5B58;&#x50A8;&#x7684;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x952E;&#x503C;&#x5BF9;&#x5E76;&#x5220;&#x9664;</span>
<span class="token comment"># &#x7531;&#x4E8E;python&#x7684;&#x5B57;&#x5178;&#x6CA1;&#x6709;&#x987A;&#x5E8F;&#xFF0C;&#x6211;&#x4EEC;&#x4E0D;&#x80FD;&#x8BF4;&#x662F;&#x5B9A;&#x4E49;&#x7684;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#xFF0C;&#x800C;&#x662F;&#x5E95;&#x5C42;&#x5B58;&#x50A8;&#x7684;&#x6700;&#x540E;&#x4E00;&#x4E2A;</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>popitem<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
<span class="token comment"># &#x4F60;&#x4E5F;&#x53EF;&#x4EE5;&#x7528;&#x4E24;&#x4E2A;&#x53D8;&#x91CF;&#x5206;&#x522B;&#x63A5;&#x6536;&#x952E;&#x548C;&#x503C;</span>
k<span class="token punctuation">,</span> v <span class="token operator">=</span> a<span class="token punctuation">.</span>popitem<span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>k<span class="token punctuation">,</span> v<span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
<span class="token comment"># fromkeys&#x65B9;&#x6CD5;&#x53EF;&#x4EE5;&#x6279;&#x91CF;&#x521B;&#x5EFA;&#x6307;&#x5B9A;key&#x7684;&#x5B57;&#x5178;&#xFF0C;&#x8FD8;&#x80FD;&#x7ED9;&#x9ED8;&#x8BA4;&#x503C;&#x3002;&#x4E2A;&#x4EBA;&#x5F88;&#x5C11;&#x7528;&#x8FD9;&#x4E2A;&#x611F;&#x89C9;</span>
<span class="token comment"># &#x7528;&#x5217;&#x8868;&#x521B;&#x5EFA;&#xFF0C;&#x4E0D;&#x7ED9;&#x9ED8;&#x8BA4;&#x503C;&#x65F6;&#x503C;&#x9ED8;&#x8BA4;&#x4E3A;None</span>
a <span class="token operator">=</span> <span class="token builtin">dict</span><span class="token punctuation">.</span>fromkeys<span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">&apos;a&apos;</span><span class="token punctuation">,</span> <span class="token string">&apos;b&apos;</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
<span class="token comment"># &#x7528;&#x5143;&#x7EC4;&#x521B;&#x5EFA;</span>
a <span class="token operator">=</span> <span class="token builtin">dict</span><span class="token punctuation">.</span>fromkeys<span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token string">&apos;a&apos;</span><span class="token punctuation">,</span> <span class="token string">&apos;b&apos;</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
<span class="token comment"># &#x6307;&#x5B9A;&#x9ED8;&#x8BA4;&#x503C;</span>
a <span class="token operator">=</span> <span class="token builtin">dict</span><span class="token punctuation">.</span>fromkeys<span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">&apos;a&apos;</span><span class="token punctuation">,</span> <span class="token string">&apos;b&apos;</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token string">&quot;&#x6211;&#x662F;&#x9ED8;&#x8BA4;&#x503C;&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
<span class="token comment"># &#x5982;&#x679C;&#x662F;&#x8FD9;&#x6837;&#x5462;&#xFF1F;&#x4F1A;&#x4E0D;&#x4F1A;&#x5206;&#x522B;&#x7ED9;a&#x3001;b&#x8D4B;&#x503C;&#x9ED8;&#x8BA4;&#x503C;&#xFF1F;&#x8BF7;&#x81EA;&#x884C;&#x5C1D;&#x8BD5;</span>
a <span class="token operator">=</span> <span class="token builtin">dict</span><span class="token punctuation">.</span>fromkeys<span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">&apos;a&apos;</span><span class="token punctuation">,</span> <span class="token string">&apos;b&apos;</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">&quot;&#x6211;&#x662F;&#x9ED8;&#x8BA4;&#x503C;&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;111&quot;</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>

<span class="token comment"># &#x9644;&#x9001;&#x4E00;&#x4E2A;&#xFF0C;&#x5229;&#x7528;&#x5B57;&#x5178;&#x6765;&#x7ED9;&#x5217;&#x8868;&#x53BB;&#x91CD;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x5C24;&#x5176;&#x9002;&#x7528;&#x5728;&#x5217;&#x8868;&#x5143;&#x7D20;&#x91CF;&#x5F88;&#x5927;&#x65F6;&#xFF0C;&#x5F88;&#x65B9;&#x4FBF;</span>
a <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">7</span><span class="token punctuation">,</span> <span class="token number">7</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">]</span>
newList <span class="token operator">=</span> <span class="token builtin">list</span><span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">.</span>fromkeys<span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">.</span>keys<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>newList<span class="token punctuation">)</span>
</code></pre>
<h3 id="&#x5355;&#x8BCD;&#x91CA;&#x4E49;"><a name="&#x5355;&#x8BCD;&#x91CA;&#x4E49;" class="anchor-navigation-ex-anchor" href="#&#x5355;&#x8BCD;&#x91CA;&#x4E49;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5355;&#x8BCD;&#x91CA;&#x4E49;</h3>
<table>
<thead>
<tr>
<th>&#x5355;&#x8BCD;</th>
<th>&#x91CA;&#x4E49;</th>
</tr>
</thead>
<tbody>
<tr>
<td>clear</td>
<td>&#x6E05;&#x9664;&#xFF0C;&#x6E05;&#x7406;</td>
</tr>
<tr>
<td>copy</td>
<td>&#x590D;&#x5236;</td>
</tr>
<tr>
<td>get</td>
<td>&#x83B7;&#x5F97;&#xFF0C;&#x5F97;&#x5230;</td>
</tr>
<tr>
<td>setdefault</td>
<td>set&#x8BBE;&#x7F6E;&#xFF0C;default&#x9ED8;&#x8BA4;&#xFF0C;&#x5408;&#x8D77;&#x6765;&#x5C31;&#x662F;&#x8BBE;&#x7F6E;&#x9ED8;&#x8BA4;&#x503C;</td>
</tr>
<tr>
<td>update</td>
<td>&#x66F4;&#x65B0;</td>
</tr>
<tr>
<td>items</td>
<td>&#x9879;&#x76EE;&#xFF0C;&#x4E00;&#x4EF6;&#x4E1C;&#x897F;&#xFF08;&#x590D;&#x6570;&#xFF09;</td>
</tr>
<tr>
<td>keys</td>
<td>key&#x952E;&#x7684;&#x590D;&#x6570;</td>
</tr>
<tr>
<td>values</td>
<td>value&#x503C;&#x7684;&#x8D4B;&#x503C;</td>
</tr>
<tr>
<td>pop</td>
<td>&#x51FA;&#x6808;</td>
</tr>
<tr>
<td>popitem</td>
<td>pop item&#x4E24;&#x4E2A;&#x5355;&#x8BCD;&#x5408;&#x8D77;&#x6765;&#xFF0C;&#x5C06;&#x4E00;&#x4EF6;&#x4E1C;&#x897F;&#x51FA;&#x6808;&#xFF0C;&#x8FD9;&#x91CC;&#x662F;&#x628A;&#x952E;&#x503C;&#x5BF9;&#x629B;&#x51FA;&#x5B57;&#x5178;&#x5916;</td>
</tr>
<tr>
<td>fromkeys</td>
<td>from&#x6765;&#x81EA;...&#xFF0C;keys&#xFF0C;&#x952E;&#x7684;&#x590D;&#x6570;&#xFF0C;&#x5408;&#x8D77;&#x6765;&#x5C31;&#x662F;&#x4EE5;&#x5F88;&#x591A;&#x952E;&#x6765;&#x600E;&#x4E48;&#x600E;&#x4E48;&#x6837;&#x7684;&#x610F;&#x601D;</td>
</tr>
</tbody>
</table>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; <a href="http://fox-9.com" target="_blank">&#x96EA;&#x5C71;&#x51CC;&#x72D0;&#x6559;&#x7A0B;</a> all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2020-09-19 12:37:45
</span></footer></body></html>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="3-5 python3小白课：字典操作基础.html" class="navigation navigation-prev " aria-label="Previous page: 3-5 python3小白课：字典操作基础">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../chapter4/" class="navigation navigation-next " aria-label="Next page: 四、流程控制">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"3-6 python3小白课：字典的常用方法","level":"1.5.6","depth":2,"next":{"title":"四、流程控制","level":"1.6","depth":1,"path":"chapter4/README.md","ref":"./chapter4/README.md","articles":[{"title":"4-1 python3小白课：if分支结构","level":"1.6.1","depth":2,"path":"chapter4/4-1 python3小白课：if分支结构.md","ref":"./chapter4/4-1 python3小白课：if分支结构.md","articles":[]},{"title":"4-2 python3小白课：while循环结构","level":"1.6.2","depth":2,"path":"chapter4/4-2 python3小白课：while循环结构.md","ref":"./chapter4/4-2 python3小白课：while循环结构.md","articles":[]},{"title":"4-3 python3小白课：for-in循环结构","level":"1.6.3","depth":2,"path":"chapter4/4-3 python3小白课：for-in循环结构.md","ref":"./chapter4/4-3 python3小白课：for-in循环结构.md","articles":[]},{"title":"4-4 python3小白课：for表达式","level":"1.6.4","depth":2,"path":"chapter4/4-4 python3小白课：for表达式.md","ref":"./chapter4/4-4 python3小白课：for表达式.md","articles":[]}]},"previous":{"title":"3-5 python3小白课：字典操作基础","level":"1.5.5","depth":2,"path":"chapter3/3-5 python3小白课：字典操作基础.md","ref":"./chapter3/3-5 python3小白课：字典操作基础.md","articles":[]},"dir":"ltr"},"config":{"plugins":["favicon","-search","-lunr","-sharing","-livereload","-highlight","prism","prism-themes","fontsettings","back-to-top-button","expandable-chapters-small","code","search-pro","splitter","donate","tbfed-pagefooter","pageview-count","auto-scroll-table","lightbox","anchor-navigation-ex","sitemap-general","ad","image-captions","autotheme","advanced-emoji","flexible-alerts","statistics","push-bd"],"styles":{"website":"/css/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy <a href='http://fox-9.com'>雪山凌狐教程</a>","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prism-themes/themes/prism-material-light.css"]},"ad":{"contentBottom":false},"statistics":{"bd_url":"https://hm.baidu.com/hm.js","cnzz_url":"https://s95.cnzz.com/z_stat.php","google_url":"https://www.googletagmanager.com/gtag/js","bd_token":"605d1993c133629d69ab2701f78d9690"},"splitter":{},"search-pro":{},"auto-scroll-table":{},"code":{"copyButtons":true},"donate":{"alipay":"/python3xiaobaike/assets/alipay-code.jpg","alipayText":"支付宝打赏","button":"赏","title":"","wechat":"/python3xiaobaike/assets/wechatpay-code.jpg","wechatText":"微信打赏"},"sitemap-general":{"prefix":"http://doc.fox-9.com/python3xiaobaike/"},"fontsettings":{"family":"sans","size":2,"theme":"white"},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"fa fa-hand-o-right","level2Icon":"fa fa-hand-o-right","level3Icon":"fa fa-hand-o-right","showLevelIcon":true},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":false,"showLevel":false},"favicon":{"shortcut":"/assets/favicon.ico","bookmark":"/assets/favicon.ico"},"lightbox":{"jquery":true,"sameUuid":false},"push-bd":{},"back-to-top-button":{},"pageview-count":{},"prism-themes":{},"expandable-chapters-small":{},"flexible-alerts":{"danger":{"className":"danger","icon":"fa fa-ban","label":"注意"},"note":{"className":"info","icon":"fa fa-info-circle","label":"说明"},"style":"flat","tip":{"className":"tip","icon":"fa fa-lightbulb-o","label":"提示"},"warning":{"className":"warning","icon":"fa fa-exclamation-triangle","label":"警告"},"question":{"label":"问题","icon":"fa fa-question-circle","className":"question"}},"autotheme":{"night":[20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],"sepia":[25,25,25,25,25,25],"white":[25,25,25,25,25,25,25,25]},"advanced-emoji":{"embedEmojis":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"image-captions":{"caption":"_CAPTION_","variable_name":"_pictures"}},"theme":"default","author":"雪山凌狐","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"CATALOG_FOR_GITBOOK.md"},"variables":{"_pictures":[{"backlink":"./chapter1/1-1 python3小白课：python语言简介.html#fig1.3.1.1","level":"1.3.1","list_caption":"Figure: 图1-1-1 龟叔","alt":"图1-1-1 龟叔","nro":1,"url":"assets/1-1-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图1-1-1 龟叔","attributes":{},"skip":false,"key":"1.3.1.1"},{"backlink":"./chapter1/1-1 python3小白课：python语言简介.html#fig1.3.1.2","level":"1.3.1","list_caption":"Figure: 图1-1-2 python2的最后一个版本官方博客","alt":"图1-1-2 python2的最后一个版本官方博客","nro":2,"url":"assets/1-1-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图1-1-2 python2的最后一个版本官方博客","attributes":{},"skip":false,"key":"1.3.1.2"},{"backlink":"./chapter1/1-2 python3小白课：python下载.html#fig1.3.2.1","level":"1.3.2","list_caption":"Figure: 图1-2-1 python官网界面","alt":"图1-2-1 python官网界面","nro":3,"url":"assets/1-2-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图1-2-1 python官网界面","attributes":{},"skip":false,"key":"1.3.2.1"},{"backlink":"./chapter1/1-2 python3小白课：python下载.html#fig1.3.2.2","level":"1.3.2","list_caption":"Figure: 图1-2-2 python3.8.2版本安装包","alt":"图1-2-2 python3.8.2版本安装包","nro":4,"url":"assets/1-2-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图1-2-2 python3.8.2版本安装包","attributes":{},"skip":false,"key":"1.3.2.2"},{"backlink":"./chapter1/1-3 python3小白课：python安装.html#fig1.3.3.1","level":"1.3.3","list_caption":"Figure: 图1-3-1 安装界面1","alt":"图1-3-1 安装界面1","nro":5,"url":"assets/1-3-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图1-3-1 安装界面1","attributes":{},"skip":false,"key":"1.3.3.1"},{"backlink":"./chapter1/1-3 python3小白课：python安装.html#fig1.3.3.2","level":"1.3.3","list_caption":"Figure: 图1-3-2 安装界面2","alt":"图1-3-2 安装界面2","nro":6,"url":"assets/1-3-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图1-3-2 安装界面2","attributes":{},"skip":false,"key":"1.3.3.2"},{"backlink":"./chapter1/1-3 python3小白课：python安装.html#fig1.3.3.3","level":"1.3.3","list_caption":"Figure: 图1-3-3 安装界面3","alt":"图1-3-3 安装界面3","nro":7,"url":"assets/1-3-3.jpg","index":3,"caption_template":"_CAPTION_","label":"图1-3-3 安装界面3","attributes":{},"skip":false,"key":"1.3.3.3"},{"backlink":"./chapter1/1-6 python3小白课：使用python IDLE.html#fig1.3.6.1","level":"1.3.6","list_caption":"Figure: 图1-6-1 python shell","alt":"图1-6-1 python shell","nro":8,"url":"assets/1-6-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图1-6-1 python shell","attributes":{},"skip":false,"key":"1.3.6.1"},{"backlink":"./chapter1/1-6 python3小白课：使用python IDLE.html#fig1.3.6.2","level":"1.3.6","list_caption":"Figure: 图1-6-2 python IDLE写py文件","alt":"图1-6-2 python IDLE写py文件","nro":9,"url":"assets/1-6-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图1-6-2 python IDLE写py文件","attributes":{},"skip":false,"key":"1.3.6.2"},{"backlink":"./chapter1/1-7 python3小白课：使用python shell.html#fig1.3.7.1","level":"1.3.7","list_caption":"Figure: 图1-7-1 进入python shell","alt":"图1-7-1 进入python shell","nro":10,"url":"assets/1-7-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图1-7-1 进入python shell","attributes":{},"skip":false,"key":"1.3.7.1"},{"backlink":"./chapter1/1-7 python3小白课：使用python shell.html#fig1.3.7.2","level":"1.3.7","list_caption":"Figure: 图1-7-2 python shell代码测试","alt":"图1-7-2 python shell代码测试","nro":11,"url":"assets/1-7-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图1-7-2 python shell代码测试","attributes":{},"skip":false,"key":"1.3.7.2"},{"backlink":"./chapter6/6-8 python3小白课：解锁你心仪的三方包.html#fig1.8.8.1","level":"1.8.8","list_caption":"Figure: 图6-8-1 pypi官网首页","alt":"图6-8-1 pypi官网首页","nro":12,"url":"assets/6-8-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图6-8-1 pypi官网首页","attributes":{},"skip":false,"key":"1.8.8.1"},{"backlink":"./chapter6/6-8 python3小白课：解锁你心仪的三方包.html#fig1.8.8.2","level":"1.8.8","list_caption":"Figure: 图6-8-2 requests搜索结果","alt":"图6-8-2 requests搜索结果","nro":13,"url":"assets/6-8-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图6-8-2 requests搜索结果","attributes":{},"skip":false,"key":"1.8.8.2"},{"backlink":"./chapter6/6-8 python3小白课：解锁你心仪的三方包.html#fig1.8.8.3","level":"1.8.8","list_caption":"Figure: 图6-8-3 包的内页","alt":"图6-8-3 包的内页","nro":14,"url":"assets/6-8-3.jpg","index":3,"caption_template":"_CAPTION_","label":"图6-8-3 包的内页","attributes":{},"skip":false,"key":"1.8.8.3"},{"backlink":"./chapter6/6-8 python3小白课：解锁你心仪的三方包.html#fig1.8.8.4","level":"1.8.8","list_caption":"Figure: 图6-8-4 下载文件页面","alt":"图6-8-4 下载文件页面","nro":15,"url":"assets/6-8-4.jpg","index":4,"caption_template":"_CAPTION_","label":"图6-8-4 下载文件页面","attributes":{},"skip":false,"key":"1.8.8.4"},{"backlink":"./chapter6/6-9 python3小白课：虚拟环境介绍和安装.html#fig1.8.9.1","level":"1.8.9","list_caption":"Figure: 图6-9-1 新建系统环境变量WORKON_HOME","alt":"图6-9-1 新建系统环境变量WORKON_HOME","nro":16,"url":"assets/6-9-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图6-9-1 新建系统环境变量WORKON_HOME","attributes":{},"skip":false,"key":"1.8.9.1"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.1","level":"1.8.10","list_caption":"Figure: 图6-10-1 创建test虚拟环境","alt":"图6-10-1 创建test虚拟环境","nro":17,"url":"assets/6-10-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图6-10-1 创建test虚拟环境","attributes":{},"skip":false,"key":"1.8.10.1"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.2","level":"1.8.10","list_caption":"Figure: 图6-10-2 退出虚拟环境","alt":"图6-10-2 退出虚拟环境","nro":18,"url":"assets/6-10-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图6-10-2 退出虚拟环境","attributes":{},"skip":false,"key":"1.8.10.2"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.3","level":"1.8.10","list_caption":"Figure: 图6-10-3 workon激活虚拟环境test","alt":"图6-10-3 workon激活虚拟环境test","nro":19,"url":"assets/6-10-3.jpg","index":3,"caption_template":"_CAPTION_","label":"图6-10-3 workon激活虚拟环境test","attributes":{},"skip":false,"key":"1.8.10.3"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.4","level":"1.8.10","list_caption":"Figure: 图6-10-4 虚拟环境下的pip","alt":"图6-10-4 虚拟环境下的pip","nro":20,"url":"assets/6-10-4.jpg","index":4,"caption_template":"_CAPTION_","label":"图6-10-4 虚拟环境下的pip","attributes":{},"skip":false,"key":"1.8.10.4"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.5","level":"1.8.10","list_caption":"Figure: 图6-10-5 删除虚拟环境test","alt":"图6-10-5 删除虚拟环境test","nro":21,"url":"assets/6-10-5.jpg","index":5,"caption_template":"_CAPTION_","label":"图6-10-5 删除虚拟环境test","attributes":{},"skip":false,"key":"1.8.10.5"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.6","level":"1.8.10","list_caption":"Figure: 图6-10-6 python3.6.6安装","alt":"图6-10-6 python3.6.6安装","nro":22,"url":"assets/6-10-6.jpg","index":6,"caption_template":"_CAPTION_","label":"图6-10-6 python3.6.6安装","attributes":{},"skip":false,"key":"1.8.10.6"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.7","level":"1.8.10","list_caption":"Figure: 图6-10-7 创建python3.6.6的虚拟环境","alt":"图6-10-7 创建python3.6.6的虚拟环境","nro":23,"url":"assets/6-10-7.jpg","index":7,"caption_template":"_CAPTION_","label":"图6-10-7 创建python3.6.6的虚拟环境","attributes":{},"skip":false,"key":"1.8.10.7"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.8","level":"1.8.10","list_caption":"Figure: 图6-10-8 python2.7.18安装","alt":"图6-10-8 python2.7.18安装","nro":24,"url":"assets/6-10-8.jpg","index":8,"caption_template":"_CAPTION_","label":"图6-10-8 python2.7.18安装","attributes":{},"skip":false,"key":"1.8.10.8"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.9","level":"1.8.10","list_caption":"Figure: 图6-10-9 创建python2.7.18的虚拟环境","alt":"图6-10-9 创建python2.7.18的虚拟环境","nro":25,"url":"assets/6-10-9.jpg","index":9,"caption_template":"_CAPTION_","label":"图6-10-9 创建python2.7.18的虚拟环境","attributes":{},"skip":false,"key":"1.8.10.9"},{"backlink":"./chapter7/7-1 python3小白课：一节课搞懂面向对象.html#fig1.9.1.1","level":"1.9.1","list_caption":"Figure: 图7-1-1 暖风机","alt":"图7-1-1 暖风机","nro":26,"url":"assets/7-1-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图7-1-1 暖风机","attributes":{},"skip":false,"key":"1.9.1.1"},{"backlink":"./chapter7/7-1 python3小白课：一节课搞懂面向对象.html#fig1.9.1.2","level":"1.9.1","list_caption":"Figure: 图7-1-2 会摇头的暖风机","alt":"图7-1-2 会摇头的暖风机","nro":27,"url":"assets/7-1-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图7-1-2 会摇头的暖风机","attributes":{},"skip":false,"key":"1.9.1.2"},{"backlink":"./chapter7/7-1 python3小白课：一节课搞懂面向对象.html#fig1.9.1.3","level":"1.9.1","list_caption":"Figure: 图7-1-3 会摇头的冷风机","alt":"图7-1-3 会摇头的冷风机","nro":28,"url":"assets/7-1-3.jpg","index":3,"caption_template":"_CAPTION_","label":"图7-1-3 会摇头的冷风机","attributes":{},"skip":false,"key":"1.9.1.3"},{"backlink":"./chapter7/7-7 python3小白课：重写父类方法和使用super函数.html#fig1.9.7.1","level":"1.9.7","list_caption":"Figure: 图7-7-1 鸡的图片","alt":"图7-7-1 鸡的图片","nro":29,"url":"assets/7-7-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图7-7-1 鸡的图片","attributes":{},"skip":false,"key":"1.9.7.1"}]},"title":"python3小白课笔记","language":"zh-hans","links":{"sidebar":{"雪山凌狐教程":"http://fox-9.com"}},"gitbook":"3.2.3","description":"python3小白课，让你不再惧怕python的入门学习"},"file":{"path":"chapter3/3-6 python3小白课：字典的常用方法.md","mtime":"2020-09-19T04:37:45.245Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-09-14T10:02:56.416Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-auto-scroll-table/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lightbox/js/lightbox.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-ad/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-autotheme/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-flexible-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-statistics/statistics.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-push-bd/plugin.js"></script>
        
    

    </body>
</html>

